<?xml version="1.0" encoding="utf-8"?>
<Instance ref.Class="ui::NewFileWindow" ref.Styles="res://DarkSkin/Apply">
  <ref.Parameter Name="ViewModel" Class="vm::IStudioModel"/>
  <ref.Parameter Name="OperationModel" Class="vm::IStudioNewFileModel"/>
  <ref.Parameter Name="Action" Class="vm::IAddFileItemAction"/>
  <Window Text="New File" ClientSize="x:640 y:480">
    <att.OperationModel-set>
      <att.SelectedFileFilter-bind>cast (vm::IProjectFactoryModel^) treeViewProjectTemplate.SelectedItem</att.SelectedFileFilter-bind>
    </att.OperationModel-set>
    <att.BoundsComposition-set PreferredMinSize="x:640 y:480"/>

    <Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5">
      <att.Rows>
        <CellOption>composeType:MinSize</CellOption>
        <CellOption>composeType:Percentage percentage:1.0</CellOption>
        <CellOption>composeType:MinSize</CellOption>
        <CellOption>composeType:MinSize</CellOption>
        <CellOption>composeType:MinSize</CellOption>
        <CellOption>composeType:MinSize</CellOption>
      </att.Rows>
      <att.Columns>
        <CellOption>composeType:MinSize</CellOption>
        <CellOption>composeType:Percentage percentage:1.0</CellOption>
        <CellOption>composeType:MinSize</CellOption>
        <CellOption>composeType:MinSize</CellOption>
      </att.Columns>

      <Cell Site="row:0 column:0" Margin="left:4 top:4 right:4 bottom:4">
        <Label Text="Select File Template to Use:"/>
      </Cell>

      <Cell Site="row:1 column:0">
        <BindableTreeView ref.Name="treeViewProjectTemplate" Alt="P" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false" ItemSource-eval="OperationModel.FileFilters" ImageProperty="SmallImage" TextProperty="Name" ChildrenProperty="Children">
          <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
        </BindableTreeView>
      </Cell>
      <Cell Site="row:1 column:1">
        <BindableListView ref.Name="listViewFileTemplate" Alt="T" View="BigIcon" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false">
          <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
          <att.ItemSource-eval>OperationModel.FilteredFileFactories</att.ItemSource-eval>
          <att.LargeImageProperty>Image</att.LargeImageProperty>
          <att.Columns>
            <ListViewColumn Text="Name" TextProperty="Name"/>
          </att.Columns>
        </BindableListView>
      </Cell>
      <Cell Site="row:1 column:2 rowSpan:1 columnSpan:2">
        <DocumentViewer EditMode="Selectable" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false">
          <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
          <att.Text-bind>(cast (vm::IFileFactoryModel^) listViewFileTemplate.SelectedItem).Description ?? ''</att.Text-bind>
        </DocumentViewer>
      </Cell>

      <Cell Site="row:2 column:0" Margin="left:4 top:4 right:4 bottom:4">
        <Label Text="File Name:"/>
      </Cell>
      <Cell Site="row:2 column:1 rowSpan:1 columnSpan:2">
        <SinglelineTextBox ref.Name="textBoxFileName" Alt="N" Text="MyFile">
          <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
        </SinglelineTextBox>
      </Cell>
      <Cell Site="row:2 column:3" Margin="left:4 top:4 right:4 bottom:4">
        <Label>
          <att.Text-bind>(cast (vm::IFileFactoryModel^) listViewFileTemplate.SelectedItem).DefaultFileExt ?? ''</att.Text-bind>
        </Label>
      </Cell>

      <Cell Site="row:3 column:0" Margin="left:4 top:4 right:4 bottom:4">
        <Label Text="Project:"/>
      </Cell>
      <Cell Site="row:3 column:1 rowSpan:1 columnSpan:3">
        <SinglelineTextBox Alt="L" Text-eval="ViewModel.WorkingProject.Name ?? ''" Readonly="true">
          <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
        </SinglelineTextBox>
      </Cell>

      <Cell Site="row:4 column:0" Margin="left:4 top:4 right:4 bottom:4">
        <Label Text="Location:"/>
      </Cell>
      <Cell Site="row:4 column:1 rowSpan:1 columnSpan:3">
        <SinglelineTextBox ref.Name="textBoxLocation" Text-eval="ViewModel.WorkingDirectory" Alt="L">
          <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
        </SinglelineTextBox>
      </Cell>

      <Cell Site="row:5 column:2">
        <Button ref.Name="buttonCreate" Text="Create" Alt="C" Enabled-bind="listViewFileTemplate.SelectedItem is not null" ev.Clicked="buttonCreate_Clicked">
          <att.BoundsComposition-set AlignmentToParent="left:-1 top:0 right:0 bottom:0" PreferredMinSize="x:100 y:24"/>
        </Button>
      </Cell>
      <Cell Site="row:5 column:3">
        <Button ref.Name="buttonCancel" Text="Cancel" Alt="X" ev.Clicked="buttonCancel_Clicked">
          <att.BoundsComposition-set AlignmentToParent="left:-1 top:0 right:0 bottom:0" PreferredMinSize="x:100 y:24"/>
        </Button>
      </Cell>
    </Table>
  </Window>
</Instance>
